﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Controls_HuiYuan : System.Web.UI.UserControl
{
    public string aa;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            left_up_ad();
            USERHUIYUAN();
        }
    }
    public void left_up_ad()
    {
        DataTable dt4 = Class1.ExecSel("select ad_Lock,ad_Url,ad_Img,ad_Location,ad_Time from AD where ad_Location=5 order by ad_ID desc");
        if (dt4.Rows[0]["ad_Lock"].ToString() == "0")
        {
            ad4.Text = "<a href=" + dt4.Rows[0]["ad_Url"].ToString() + " target=_blank><img src=" + dt4.Rows[0]["ad_Img"].ToString() + " border=0 width=50 height=167/></a>";
        }
        else
        {
            ad4.Text = "<img src=img/ad4.gif />";
        }
    }
    public void USERHUIYUAN()
    {
        string strSQL = "select top 9 wj_ID, case when len(wj_CompanyName)>13 then left(wj_CompanyName,13)+'' else wj_CompanyName end as wj_CompanyName from wj_User where uFlg=0 and wj_true=1 order by wj_ID desc";
        IDataReader dr = Class1.GetDataReader(strSQL);
        //and wj_true=1
        int i = 1;
        while (dr.Read())
        {
            string p_UserID = dr["wj_ID"].ToString();
            USERLI.Text += "<div class=zl-r1>" + i + "</div><div class=zl-r2><a href='Company/Index-" + p_UserID + ".html' target=_blank>" + dr["wj_CompanyName"].ToString().Trim() + "</a></div>";
            i++;
        }
        dr.Close();
        dr.Dispose();
    }
}
